1. Field of the Invention
The present invention relates to performing arithmetic operations on interval operands within a computer system. More specifically, the present invention relates to a method and an apparatus for performing minimum and maximum operations to facilitate interval multiplication and/or interval division operations in the xe2x80x9csimplexe2x80x9d interval system.
2. Related Art
Rapid advances in computing technology make it possible to perform trillions of computational operations each second. This tremendous computational speed makes it practical to perform computationally intensive tasks as diverse as predicting the weather and optimizing the design of an aircraft engine. Such computational tasks are typically performed using machine-representable floating-point numbers to approximate values of real numbers. (For example, see the Institute of Electrical and Electronics Engineers (IEEE) standard 754 for binary floating-point numbers.)
In spite of their limitations, floating-point numbers are generally used to perform most computational tasks.
One limitation is that machine-representable floating-point numbers have a fixed-size word length, which limits their accuracy. Note that a floating-point number is typically encoded using a 32, 64 or 128-bit binary number, which means that there are only 232, 264 or 2128 possible symbols that can be used to specify a floating-point number. Hence, most real number values can only be approximated with a corresponding floating-point number. This creates estimation errors that can be magnified through even a few computations, thereby adversely affecting the accuracy of a computation.
A related limitation is that floating-point numbers contain no information about their accuracy. Most measured data values include some amount of error that arises from the measurement process itself. This error can often be quantified as an accuracy parameter, which can subsequently be used to determine the accuracy of a computation. However, floating-point numbers are not designed to keep track of accuracy information, whether from input data measurement errors or machine rounding errors. Hence, it is not possible to determine the accuracy of a computation by merely examining the floating-point number that results from the computation.
Interval arithmetic has been developed to solve the above-described problems. Interval arithmetic represents numbers as intervals specified by a first (left) endpoint and a second (right) endpoint. For example, the interval [a, b], where a less than b, is a closed, bounded subset of the real numbers, R, which includes a and b as well as all real numbers between a and b. Arithmetic operations on interval operands (interval arithmetic) are defined so that interval results always contain the entire set of possible values. The result is a mathematical system for rigorously bounding numerical errors from all sources, including measurement data errors, machine rounding errors and their interactions. (Note that the first endpoint normally contains the xe2x80x9cinfimumxe2x80x9d, which is the largest number that is less than or equal to each of a given set of real numbers. Similarly, the second endpoint normally contains the xe2x80x9csupremumxe2x80x9d, which is the smallest number that is greater than or equal to each of the given set of real numbers.)
However, computer systems are presently not designed to efficiently handle intervals and interval computations. Consequently, performing interval operations on a typical computer system can be hundreds of times slower than performing conventional floating-point operations. In addition, without a special representation for intervals, interval arithmetic operations fail to produce results that are as narrow as possible.
What is needed is a method and an apparatus for efficiently performing arithmetic operations on intervals with results that are as narrow as possible. (Interval results that are as narrow as possible are said to be xe2x80x9csharpxe2x80x9d.)
One performance problem occurs during minimum and maximum computations for interval multiplication and interval division operations. For example, the result of multiplying two intervals, [a, b]xc3x97[c, d]=[min(ac, ac, bc, bd), max(ac, ad, bc, bd)] (with appropriate rounding).
During these minimum and maximum computations, many special cases arise. For example, the minimum and maximum computations must deal with special cases for empty intervals, underflow conditions and overflow conditions.
These special cases are presently handled through computer code that includes numerous xe2x80x9cifxe2x80x9d statements to detect the special cases. Unfortunately, this code for dealing with special cases can occupy a large amount of memory. This makes it impractical to insert the code for the minimum and maximum operations xe2x80x9cinlinexe2x80x9dxe2x80x94as opposed to calling a function to perform the min-max operation. Moreover, executing the code for dealing with special cases can be time-consuming, thereby degrading computational performance.
What is needed is a method and apparatus for efficiently performing minimum and maximum operations for interval multiplication and/or interval division operations.
One embodiment of the present invention provides a system for performing a minimum computation for an interval multiplication operation. This system receives four floating-point numbers, including a first floating-point number, a second floating-point number, a third floating-point number and a fourth floating-point number. The system then computes a minimum of the four floating-point numbers, wherein if the four floating-point numbers include one or more default NaN (not-a-number) values, the system sets the minimum to negative infinity.
In one embodiment of the present invention, the minimum is a left endpoint of a resulting interval from the interval multiplication operation. In this embodiment: the first floating-point number is the result of a multiplication operation between the left endpoint of a first interval and the left endpoint of a second interval; the second floating-point number is the result of a multiplication operation between the left endpoint of the first interval and the right endpoint of the second interval; the third floating-point number is the result of a multiplication operation between the right endpoint of the first interval and the left endpoint of the second interval; and the fourth floating-point number is the result of a multiplication operation between the right endpoint of the first interval and the right endpoint of the second interval.
In one embodiment of the present invention, computing the minimum involves setting the minimum to a value representing the empty interval, if any of the four floating-point numbers contain the value representing the empty interval. In a variation on this embodiment, the value representing the empty interval is a non-default NaN value.
In one embodiment of the present invention, if none of the four floating-point numbers is a default NaN value or a value representing the empty interval, computing the minimum involves selecting the minimum of the four floating-point numbers.
One embodiment of the present invention provides a system for performing a maximum computation for an interval multiplication operation, comprising. This system receives four floating-point numbers, including a first floating-point number, a second floating-point number, a third floating-point number and a fourth floating-point number. The system then computes a maximum of the four floating-point numbers, wherein if the four floating-point numbers include one or more default NaN (not-a-number) values, the system sets the maximum to positive infinity.
In one embodiment of the present invention, the maximum is a right endpoint of a resulting interval from the interval multiplication operation.
In one embodiment of the present invention, computing the maximum involves setting the maximum to a value representing the empty interval, if any of the four floating-point numbers contain the value representing the empty interval.
In one embodiment of the present invention, if none of the four floating-point numbers is a default NaN value or a value representing the empty interval, computing the maximum involves selecting the maximum of the four floating-point numbers.
One embodiment of the present invention provides a system for performing a minimum computation for an interval division operation. This system receives four floating-point numbers, including a first floating-point number, a second floating-point number, a third floating-point number and a fourth floating-point number. The system then computes a minimum of the four floating-point numbers, wherein if the four floating-point numbers include one or more default NaN (not-a-number) values, the default NaN values are ignored in computing the minimum.
In one embodiment of the present invention, the first floating-point number is the result of a division operation between the left endpoint of a first interval and the left endpoint of a second interval; the second floating-point number is the result of a division operation between the left endpoint of the first interval and the right endpoint of the second interval; the third floating-point number is the result of a division operation between the right endpoint of the first interval and the left endpoint of the second interval; and the fourth floating-point number is the result of a division operation between the right endpoint of the first interval and the right endpoint of the second interval.
In one embodiment of the present invention, computing the minimum involves setting the minimum to negative infinity, if the second interval contains zero.
One embodiment of the present invention provides a system for performing a maximum computation for an interval division operation. This system receives four floating-point numbers, including a first floating-point number, a second floating-point number, a third floating-point number and a fourth floating-point number. The system then computes a maximum of the four floating-point numbers, wherein if the four floating-point numbers include one or more default NaN (not-a-number) values, the default NaN values are ignored in computing the maximum.
In one embodiment of the present invention, computing the maximum involves setting the maximum to positive infinity, if the second interval contains zero.